<?php
/**
 * Created by PhpStorm.
 * User: tjjs
 * Date: 17-7-18
 * Time: 下午3:13
 */

namespace ActionsHttp;

use Data\Order_form_DAO;
use Data\Reminder_order_form_DAO;
use Utils\SysUtils;

class RestaurantReminderConfirm extends BaseActionHttp
{
    public function doAction() {
        parent::doAction();
        // 订单id
        $order_form_id = (int)$this->data[ORDER_FORM_ID];

        $order_form_record = Order_form_DAO::getRecord($order_form_id);

        if (!$order_form_record) {
            return $this->SendErrMsg("没有此订单");
        }

        if ($order_form_record->getREMINDER_STATUS() == REMINDER_STATUS_START) {
            $order_form_record->setREMINDER_STATUS(REMINDER_STATUS_RESPONSE);
            Order_form_DAO::update($order_form_record);
        }

        // 返回数据
        $this->ResponseDataToCurrentClient();
    }
}